package com.duty.UI;

import com.duty.UI.R;
import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;

// this is the activity where users select the type of alcohol for import
public class AlcoholActivity extends Activity {

	private String province_extra;
	
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);

        setContentView(R.layout.alcohol);
        
        //retrieve province from last activity
        Bundle extras = getIntent().getExtras();
        province_extra = extras.getString("province");
               
		Button btnSpirits = (Button) findViewById(R.id.btnSpirits);
		btnSpirits.setOnClickListener(new OnClickListener() {
			@Override
			public void onClick(View component) {
				// go to the spirits page
				Intent spirits = new Intent(AlcoholActivity.this, CalculateSpirits.class);
				spirits.putExtra("province", province_extra);
				startActivity(spirits);
			}
		});
		
		Button btnSpiritCoolers = (Button) findViewById(R.id.btnSpiritCoolers);
		btnSpiritCoolers.setOnClickListener(new OnClickListener() {
			@Override
			public void onClick(View component) {
				// go to the spirit cooler page
				Intent spritCoolers = new Intent(AlcoholActivity.this, CalculateSpiritCool.class);
				spritCoolers.putExtra("province", province_extra);
				startActivity(spritCoolers);
			}
		});
		
		Button btnWine = (Button) findViewById(R.id.btnWine);
		btnWine.setOnClickListener(new OnClickListener() {
			@Override
			public void onClick(View component) {
				// go to the wine page
				Intent wine = new Intent(AlcoholActivity.this, CalculateWine.class);
				wine.putExtra("province", province_extra);
				startActivity(wine);
			}
		});
		
		Button btnSparklingWine = (Button) findViewById(R.id.btnSparklingWine);
		btnSparklingWine.setOnClickListener(new OnClickListener() {
			@Override
			public void onClick(View component) {
				// go to the sparkling wine page
				Intent sparklingWine = new Intent(AlcoholActivity.this, CalculateSparkling.class);
				sparklingWine.putExtra("province", province_extra);
				startActivity(sparklingWine);
			}
		});
		
		Button btnWineCoolers = (Button) findViewById(R.id.btnWineCoolers);
		btnWineCoolers.setOnClickListener(new OnClickListener() {
			@Override
			public void onClick(View component) {
				// go to the wine coolers page
				Intent wineCoolers = new Intent(AlcoholActivity.this, CalculateWineCoolers.class);
				wineCoolers.putExtra("province", province_extra);
				startActivity(wineCoolers);
			}
		});
		
		Button btnCider = (Button) findViewById(R.id.btnCider);
		btnCider.setOnClickListener(new OnClickListener() {
			@Override
			public void onClick(View component) {
				// go to the cider page
				Intent cider = new Intent(AlcoholActivity.this, CalculateCider.class);
				cider.putExtra("province", province_extra);
				startActivity(cider);
			}
		});
		
		Button btnBeer = (Button) findViewById(R.id.btnBeer);
		btnBeer.setOnClickListener(new OnClickListener() {
			@Override
			public void onClick(View component) {
				// go to the beer page
				Intent beer = new Intent(AlcoholActivity.this, CalculateBeer.class);
				beer.putExtra("province", province_extra);
				startActivity(beer);
			}
		});
         
    }
	
}

